<template>
  <div>
    <!-- 日志 -->
    <el-timeline style="max-width: 600px" v-if="tableData.length > 0">
      <el-timeline-item
        v-for="(item, index) in tableData"
        :key="index"
        :timestamp="item.createTime"
        type="primary"
      >
        {{ item.logInfo }}
      </el-timeline-item>
    </el-timeline>
    <el-empty description="暂无日志" v-else />
  </div>
</template>

<script setup>
import { ref, onMounted } from "vue";
import { ElMessage, ElMessageBox } from "element-plus";
import { handleApiResponse } from "@/utils/request.js";
import { GetGlassesStorePurchaseOrderRecordList } from "../../../../../wailsjs/go/api/OrderApi";

onMounted(() => {
  getList();
});
const props = defineProps(["detailId"]);

const tableData = ref([]);

async function getList() {
  handleApiResponse(() =>
    GetGlassesStorePurchaseOrderRecordList({
      orderId: props.detailId,
      page: 1,
      size: 1000,
    })
  ).then((res) => {
    if (res.code == 0) {
      tableData.value = res.data.list || [];
    }
  });
}
</script>

<style scoped lang="scss">
</style>